package com.supcon.exchangedata.repository.slave6;


import com.supcon.exchangedata.pojo.entity.mysql.operation.hj.HjElectricityInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * 环境发电信息
 *
 * @Author: yangbin
 * @Date: 2022/04/20/9:00
 * @Description:
 */
public interface SlaveHjOperationInfo8 extends JpaRepository<HjElectricityInfo, Long> {


    @Transactional
    @Query(nativeQuery = true, value = "SELECT * FROM hj_electricity_info WHERE day = (SELECT MAX(day) FROM hj_electricity_info) limit 1")
    List<HjElectricityInfo> findTopData();

    List<HjElectricityInfo> findAllByDayBetween(String startTime, String endTime);


}
